<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>实现并发控制</title>
  <!-- https://mp.weixin.qq.com/s/JutrrNaSdxeMaP49ucWjzA -->
</head>

<body>

</body>
<script>
  class Queue {
    constructor() {
      this._queue = [];
    }

    push(value) {
      return this._queue.push(value);
    }

    shift() {
      return this._queue.shift();
    }

    isEmpty() {
      return this._queue.length === 0;
    }
  };
  class DelayedTask {
    constructor(resolve, fn, args) {
      this.resolve = resolve;
      this.fn = fn;
      this.args = args;
    }
  };
  
</script>

</html>